package com.tanhua.autoconfig;


import com.tanhua.autoconfig.properties.AipFaceProperties;
import com.tanhua.autoconfig.properties.HuanXinProperties;
import com.tanhua.autoconfig.properties.OssProperties;
import com.tanhua.autoconfig.properties.SmsProperties;
import com.tanhua.autoconfig.template.ApiTemplate;
import com.tanhua.autoconfig.template.HuanXinTemplate;
import com.tanhua.autoconfig.template.OssTemplate;
import com.tanhua.autoconfig.template.SmsTemplate;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.annotation.Bean;

//开启属性自动装配 同时将properties对象注入容器
@EnableConfigurationProperties({SmsProperties.class,OssProperties.class,AipFaceProperties.class, HuanXinProperties.class})
public class TanhuaAutoConfiguration {

    @Bean
    public SmsTemplate smsTemplate(SmsProperties properties) {
        return new SmsTemplate(properties);
    }
    @Bean
    public OssTemplate ossTemplate(OssProperties properties){ return new OssTemplate(properties);}
    @Bean
    public ApiTemplate apiTemplate(){return new ApiTemplate();}
    @Bean
    public HuanXinTemplate huanXinTemplate(HuanXinProperties huanXinProperties){return new HuanXinTemplate(huanXinProperties);}
}
